﻿using UnityEngine;
using System.Collections;

public class Plane : MonoBehaviour 
{
	public int maxHp;
	private int hp;
	public GameObject explosionFX;

	protected virtual void Start()
	{
		hp = maxHp;
	}
	public virtual void GetHurt(int value)
	{
		hp -= value;
		if (hp<=0)
		{
			Die ();
		}
	}
	protected virtual void Die()
	{
		Instantiate (explosionFX, transform.position, transform.rotation);
		Destroy (this.gameObject);
	}
}
